Twitter Network Analyses
  • Lehrkräftebildung
  • Bildungsgipfel
  • NeustartBildungJetzt

Contents

  • Visualizing the Network
  • Calculating the Importance of Users in the Network
    • In-degree centrality / users getting a lot of retweets
    • Out-degree centrality / users retweeting a lot
    • Betweeness centrality / users connecting different communities
  • Acknowledgements

Analyses of retweets on the topic of Lehrkräftebildung

Information about the dataset:

Code
# PREPARE DATA
import json
import pandas as pd

from src.analysis_functions import (
    get_query_info,
    get_time_range,
    metadata_prints,
    prep_data,
)

title = "Lehrkräftebildung"
topic_name = "lehrkraeftebildung"
data_path = "data/raw/all_tweets_lehrkraeftebildung.parquet"

# get information about the topic
search_words, query_conds = get_query_info(
    json_file="assets/topics.json", topic_name=topic_name
)

# load dataset
df = prep_data(data_path)

# get information about the time range
start_date, end_date = get_time_range(df, "de_DE")

metadata_prints(df, start_date, end_date, search_words, query_conds)

# drop retweets with missing usernames
try:
    missing_usernames = df.tweet_author_username.isnull().value_counts()[True]
except KeyError:
    missing_usernames = 0
df = df.dropna(subset=["tweet_author_username"])
print(
    f"\nNumber of retweets with missing usernames for the original tweeter: {missing_usernames}\nThese are being dropped from the analysis. New total of retweets: {len(df)}\n"
)
Number of total retweets in this dataset: 
24689

Time range of the retweets:
February 23, 2023 - June  8, 2023

Keywords* used to collect the retweets:
(Lehrkräftebildung OR Lehrerbildung OR Lehrkräfte OR Lehrkräftefortbildung OR Seiteneinstieg OR Quereinstieg OR Lehramt)

Query conditions used to collect the retweets:
(is:retweet OR is:quote) lang:de

Number of retweets with missing usernames for the original tweeter: 277
These are being dropped from the analysis. New total of retweets: 24412

*They keywords above mean the retweets were collected from Twitter whenever any of the above keywords were found in the text of the retweet.

Visualizing the Network

Here are a few important things to note about the network visualization:

  • Every node (i.e. circle) represents a Twitter user.
  • The colour of the node represents the number of times that user’s tweets were retweeted. In other words, the darker the colour of the node, the more times that user was retweeted by other users. Those who only retweet and do not produce any tweets themselves are coloured bright yellow.
  • Similarly, the size of the node represents how many connections each node has. This includes incoming and outgoing connections, meaning both how many times they retweeted another user’s tweet and how many times their original tweets were retweeted. So both users who get retweeted very often by other users (i.e. content producers) and users who simply retweet a lot (i.e. content spreaders or even bots) will have larger sizes.
Code
from src.analysis_functions import generate_network_graph

popular_tweeters, bridging_users, active_retweeters = generate_network_graph(df, title)

Calculating the Importance of Users in the Network

Below are three measures of centrality for each user in the network:

  • In-degree centrality represents the number of connections going into a node.
    • In the case of retweets, in-degree centrality will indicate that a user is getting a large number of retweets.
  • Out-degree centrality represents the number of connections going out of a node.
    • In the case of retweets, out-degree centrality will indicate that a user is retweeting a lot.
  • Betweeness centrality represents the number of ‘shortest paths’ between nodes that pass through through a specific node.
    • In the case of retweets, it measures the extent to which a user connects different communities of users.
Code
from src.analysis_functions import get_authors_name, get_top_users

authors = get_authors_name(df)

In-degree centrality / users getting a lot of retweets

Below are the top 20 users with the most in-degree centrality / retweeted tweets.

Code
get_top_users(popular_tweeters, authors, "in-degree_centrality", 20)
in-degree_centrality in-degree_centrality (normalised) username name profile_url
1 0.15970 1.00000 PSHolstein Philipp S. Holstein https://twitter.com/PSHolstein
2 0.04251 0.26617 BentFreiwald Bent Freiwald https://twitter.com/BentFreiwald
3 0.03852 0.24122 leseerlaubnis LesenUndTeilen© https://twitter.com/leseerlaubnis
4 0.02834 0.17745 blume_bob Nᴇᴛᴢʟᴇʜʀᴇʀ https://twitter.com/blume_bob
5 0.02472 0.15481 DurdenGaming Durden https://twitter.com/DurdenGaming
6 0.02354 0.14741 Georg_Pazderski Georg Pazderski https://twitter.com/Georg_Pazderski
7 0.02133 0.13355 ZDFheute ZDFheute https://twitter.com/ZDFheute
8 0.02118 0.13262 AndreasKemper NaN https://twitter.com/AndreasKemper
9 0.01860 0.11645 juliansfrth Julian Seiferth https://twitter.com/juliansfrth
10 0.01749 0.10952 lueckenbildung Dominik Schöneberg https://twitter.com/lueckenbildung
11 0.01624 0.10166 WDRaktuell WDR aktuell https://twitter.com/WDRaktuell
12 0.01624 0.10166 BildungSicher #BildungAberSicher https://twitter.com/BildungSicher
13 0.01491 0.09335 DrKissler Alexander Kissler https://twitter.com/DrKissler
14 0.01469 0.09196 AnthroBlogger Oliver Rautenberg | @AnthroBlogger@chaos.social https://twitter.com/AnthroBlogger
15 0.01461 0.09150 Deu_Kurier NaN https://twitter.com/Deu_Kurier
16 0.01314 0.08226 RicardoLange4 NaN https://twitter.com/RicardoLange4
17 0.01203 0.07532 fingurplaustert MissTrelawny (sic!) https://twitter.com/fingurplaustert
18 0.01188 0.07440 KaiGehring Kai Gehring https://twitter.com/KaiGehring
19 0.01173 0.07348 watch_union UnionWatch / @watch_union@mastodon.social https://twitter.com/watch_union
20 0.01114 0.06978 AmadeuAntonio NaN https://twitter.com/AmadeuAntonio

Out-degree centrality / users retweeting a lot

Below are the top 20 users with the most out-degree centrality / retweets.

Code
get_top_users(active_retweeters, authors, "out-degree_centrality", 20)
out-degree_centrality out-degree_centrality (normalised) username name profile_url
1 0.03779 1.00000 Bot_TwLehrerZ Bot Tw!tterlehrerzimmer https://twitter.com/Bot_TwLehrerZ
2 0.00399 0.10547 Doriiien Doris Niehoff https://twitter.com/Doriiien
3 0.00325 0.08594 goesicke Kai-Uwe Gösicke https://twitter.com/goesicke
4 0.00310 0.08203 Ju1820 J R https://twitter.com/Ju1820
5 0.00258 0.06836 lothenon Lothenon https://twitter.com/lothenon
6 0.00236 0.06250 seni_bl Ines Bieler https://twitter.com/seni_bl
7 0.00236 0.06250 Mandala81966 Mandala #TeamKinderschutz 😷 https://twitter.com/Mandala81966
8 0.00229 0.06055 KinderJournal Zuwendung https://twitter.com/KinderJournal
9 0.00221 0.05859 DBS_20 DeutscherBildungsserver@bildung.social https://twitter.com/DBS_20
10 0.00214 0.05664 nicole37911 nicole3791, B.A. https://twitter.com/nicole37911
11 0.00192 0.05078 FloriKohl Flori Kohl 🦊|BY https://twitter.com/FloriKohl
12 0.00192 0.05078 miaumiau1975 😷 https://twitter.com/miaumiau1975
13 0.00185 0.04883 Arsenio57509279 Arsenio https://twitter.com/Arsenio57509279
14 0.00185 0.04883 lgoshen NaN https://twitter.com/lgoshen
15 0.00170 0.04492 ThomasKnorra Thomas Knorra 😷🌍 https://twitter.com/ThomasKnorra
16 0.00170 0.04492 lurhenne Lisa Urhahn https://twitter.com/lurhenne
17 0.00170 0.04492 eduBWbot eduBWbot https://twitter.com/eduBWbot
18 0.00170 0.04492 julian07646263 jules https://twitter.com/julian07646263
19 0.00162 0.04297 13Myri Myri W. 📯 #StandWithUkraine 🇺🇦 https://twitter.com/13Myri
20 0.00162 0.04297 _Kinderrechte_ ☮️Kinderrechte 😷 https://twitter.com/_Kinderrechte_

Betweeness centrality / users connecting different communities

Below are the top 20 users with the most betweeness centrality / connecting different communities.

Code
get_top_users(bridging_users, authors, "betweenness", 20)
betweenness betweenness (normalised) username name profile_url
1 0.01596 1.00000 Bot_TwLehrerZ Bot Tw!tterlehrerzimmer https://twitter.com/Bot_TwLehrerZ
2 0.01486 0.93094 susanneposselt Susanne Posselt • #EduBW https://twitter.com/susanneposselt
3 0.00878 0.55013 lernendigitalDE Kompetenzverbund lernen:digital https://twitter.com/lernendigitalDE
4 0.00861 0.53938 DBS_20 DeutscherBildungsserver@bildung.social https://twitter.com/DBS_20
5 0.00715 0.44771 HSE_Heidelberg Heidelberg School of Education https://twitter.com/HSE_Heidelberg
6 0.00710 0.44505 sdw_Stiftung Stiftung der Deutschen Wirtschaft (sdw) https://twitter.com/sdw_Stiftung
7 0.00666 0.41750 SenBJF Senatsverwaltung für Bildung, Jugend und Familie https://twitter.com/SenBJF
8 0.00641 0.40127 AndreasKemper NaN https://twitter.com/AndreasKemper
9 0.00640 0.40067 PartnerSchule PartnerSchuleWirtschaft https://twitter.com/PartnerSchule
10 0.00449 0.28140 leseerlaubnis LesenUndTeilen© https://twitter.com/leseerlaubnis
11 0.00380 0.23817 BentFreiwald Bent Freiwald https://twitter.com/BentFreiwald
12 0.00341 0.21390 FloriKohl Flori Kohl 🦊|BY https://twitter.com/FloriKohl
13 0.00306 0.19143 FrauFuchs5 @FrauFuchs5@sueden.social https://twitter.com/FrauFuchs5
14 0.00215 0.13458 ForumBilDig Forum Bildung Digitalisierung https://twitter.com/ForumBilDig
15 0.00212 0.13268 joschafalck Joscha Falck https://twitter.com/joschafalck
16 0.00198 0.12384 ciffi christian füller https://twitter.com/ciffi
17 0.00163 0.10236 DerMedienwart Medienwart | FCKWR | medien.kompetenz.schulen https://twitter.com/DerMedienwart
18 0.00163 0.10197 blume_bob Nᴇᴛᴢʟᴇʜʀᴇʀ https://twitter.com/blume_bob
19 0.00160 0.10042 telekomstiftung telekomstiftung https://twitter.com/telekomstiftung
20 0.00141 0.08834 Woe_Real Kai Wörner https://twitter.com/Woe_Real

Acknowledgements

  • The text and code for this analysis draws heavily from this template provided by DataCamp.